/*
 * Copyright 2011 The Rusted Roof, LLC.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package org.proteusframework.platformservice.persistence.vfs;

import org.proteusframework.core.api.IPlatformDelegate;
import org.proteusframework.platformservice.persistence.api.IVFSVisitor;
import org.proteusframework.platformservice.persistence.vfs.FilePath;
import org.proteusframework.platformservice.persistence.api.IVFSFile;
import org.proteusframework.platformservice.persistence.api.IVFSManager;

import java.util.List;

public final class NullVFSManager implements IVFSManager
{
    private static final String UNSUPPORTED_OP_MSG = "NullVFSManager does not support virtual file system operations";

    @Override
    public boolean supportsVFSManagement()
    {
        return false;
    }

    @Override
    public IVFSFile createFile(FilePath filePath)
    {
        throw new UnsupportedOperationException(UNSUPPORTED_OP_MSG);
    }

    @Override
    public boolean hasFile(FilePath filePath)
    {
        throw new UnsupportedOperationException(UNSUPPORTED_OP_MSG);
    }

    @Override
    public List<IVFSFile> getFiles(FilePath filePath)
    {
        throw new UnsupportedOperationException(UNSUPPORTED_OP_MSG);
    }

    @Override
    public IVFSFile getFile(FilePath filePath)
    {
        throw new UnsupportedOperationException(UNSUPPORTED_OP_MSG);
    }

    @Override
    public boolean deleteFile(IVFSFile vfsFile)
    {
        throw new UnsupportedOperationException(UNSUPPORTED_OP_MSG);
    }

    @Override
    public boolean deleteFile(FilePath filePath)
    {
        throw new UnsupportedOperationException(UNSUPPORTED_OP_MSG);
    }

    @Override
    public <T extends IPlatformDelegate> void setPlatformDelegate(IPlatformDelegate delegate, Class<T> delegateInterface)
    {
        // Ignore
    }

    @Override
    public void accept(IVFSVisitor visitor)
    {
        throw new UnsupportedOperationException(UNSUPPORTED_OP_MSG);
    }
}
